﻿@{
    ViewBag.Title = "1收发综合统计表";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}



<script>
    var moduleId = $.request("moduleId");
    $(function () {
        initControl();
        gridList();
        })
        function initControl() {
            $('select').bindSelect();
            //供货单位名称
            $("#FProCompanyNO").bindSelect({
                url: "/BaseData/ZSJ_B1_GH_SI/GetGridJson?isProduct=1",
                id: "UnitNO",
                text: "UnitNOShortName"
            });
            //显示台账日期
            var keyValue = $.request("keyValue");
            $.ajax({
                url: "/WareHouse/EnterWareHouse/GetInfoDocumentNum",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                    //var dataa =  data.Substring(0, 4);
                    //alert("a");
                    $("#FAccountDate").val(data);
                }
            });
            //零件分类
            $("#FProductionTypeName").bindSelect({//FClassNO ='01' 
                url: "/VBaseData/V_BUS_SJ_Dictionary/GetSJ_DictionaryEntity",
                id: "UseUnit",
                text: "FTypeName",
            });
        }
    function gridList() {
        var $gridList = $("#gridList");
        $("#gridList").dataGrid({
            url: "/VBaseData/V_CPK_A1_BB_StoProStockCata_RB/GetGridJson",
            height: $(window).height() - 150,
            colModel: [
            { label: 'FAccountDate', name: 'FAccountDate', width: 60, align: 'right', hidden:true },
            { label: '零件编号', name: 'FProductionNO', width: 100, align: 'left' },
            { label: '零件名称', name: 'FProductionName', width: 160, align: 'left' },
            { label: "供货单位编码", name: "FProCompanyNO", width: 120, align: 'left' },
            { label: '供货单位名称', name: 'FProCompanyName', width: 120, align: 'left' },
            { label: '结存<br/>数量', name: 'JCSL', width: 40, align: 'right' },
            { label: '期初<br/>数量', name: 'QCSL', width: 40, align: 'right' },

            { label: '01日<br/>入库', name: 'RK01', width: 40, align: 'right' },
            { label: '02日<br/>入库', name: 'RK02', width: 40, align: 'right' },
            { label: '03日<br/>入库', name: 'RK03', width: 40, align: 'right' },
            { label: '04日<br/>入库', name: 'RK04', width: 40, align: 'right' },
            { label: '05日<br/>入库', name: 'RK05', width: 40, align: 'right' },
            { label: '06日<br/>入库', name: 'RK06', width: 40, align: 'right' },
            { label: '07日<br/>入库', name: 'RK07', width: 40, align: 'right' },
            { label: '08日<br/>入库', name: 'RK08', width: 40, align: 'right' },
            { label: '09日<br/>入库', name: 'RK09', width: 40, align: 'right' },
            { label: '10日<br/>入库', name: 'RK10', width: 40, align: 'right' },
            { label: '11日<br/>入库', name: 'RK11', width: 40, align: 'right' },
            { label: '12日<br/>入库', name: 'RK12', width: 40, align: 'right' },
            { label: '13日<br/>入库', name: 'RK13', width: 40, align: 'right' },
            { label: '14日<br/>入库', name: 'RK14', width: 40, align: 'right' },
            { label: '15日<br/>入库', name: 'RK15', width: 40, align: 'right' },
            { label: '16日<br/>入库', name: 'RK16', width: 40, align: 'right' },
            { label: '17日<br/>入库', name: 'RK17', width: 40, align: 'right' },
            { label: '18日<br/>入库', name: 'RK18', width: 40, align: 'right' },
            { label: '19日<br/>入库', name: 'RK19', width: 40, align: 'right' },
            { label: '20日<br/>入库', name: 'RK20', width: 40, align: 'right' },
            { label: '21日<br/>入库', name: 'RK21', width: 40, align: 'right' },
            { label: '22日<br/>入库', name: 'RK22', width: 40, align: 'right' },
            { label: '23日<br/>入库', name: 'RK23', width: 40, align: 'right' },
            { label: '24日<br/>入库', name: 'RK24', width: 40, align: 'right' },
            { label: '25日<br/>入库', name: 'RK25', width: 40, align: 'right' },
            { label: '26日<br/>入库', name: 'RK26', width: 40, align: 'right' },
            { label: '27日<br/>入库', name: 'RK27', width: 40, align: 'right' },
            { label: '28日<br/>入库', name: 'RK28', width: 40, align: 'right' },
            { label: '29日<br/>入库', name: 'RK29', width: 40, align: 'right' },
            { label: '30日<br/>入库', name: 'RK30', width: 40, align: 'right' },
            { label: '31日<br/>入库', name: 'RK31', width: 40, a40lign: 'right' },

            { label: '入库汇总', name: 'RKHZ', width: 60, align: 'left' },

            { label: '01日<br/>入库', name: 'CK01', width: 40, align: 'right' },
            { label: '02日<br/>入库', name: 'CK02', width: 40, align: 'right' },
            { label: '03日<br/>入库', name: 'CK03', width: 40, align: 'right' },
            { label: '04日<br/>入库', name: 'CK04', width: 40, align: 'right' },
            { label: '05日<br/>入库', name: 'CK05', width: 40, align: 'right' },
            { label: '06日<br/>入库', name: 'CK06', width: 40, align: 'right' },
            { label: '07日<br/>入库', name: 'CK07', width: 40, align: 'right' },
            { label: '08日<br/>入库', name: 'CK08', width: 40, align: 'right' },
            { label: '09日<br/>入库', name: 'CK09', width: 40, align: 'right' },
            { label: '10日<br/>入库', name: 'CK10', width: 40, align: 'right' },
            { label: '11日<br/>入库', name: 'CK11', width: 40, align: 'right' },
            { label: '12日<br/>入库', name: 'CK12', width: 40, align: 'right' },
            { label: '13日<br/>入库', name: 'CK13', width: 40, align: 'right' },
            { label: '14日<br/>入库', name: 'CK14', width: 40, align: 'right' },
            { label: '15日<br/>入库', name: 'CK15', width: 40, align: 'right' },
            { label: '16日<br/>入库', name: 'CK16', width: 40, align: 'right' },
            { label: '17日<br/>入库', name: 'CK17', width: 40, align: 'right' },
            { label: '18日<br/>入库', name: 'CK18', width: 40, align: 'right' },
            { label: '19日<br/>入库', name: 'CK19', width: 40, align: 'right' },
            { label: '20日<br/>入库', name: 'CK20', width: 40, align: 'right' },
            { label: '21日<br/>入库', name: 'CK21', width: 40, align: 'right' },
            { label: '22日<br/>入库', name: 'CK22', width: 40, align: 'right' },
            { label: '23日<br/>入库', name: 'CK23', width: 40, align: 'right' },
            { label: '24日<br/>入库', name: 'CK24', width: 40, align: 'right' },
            { label: '25日<br/>入库', name: 'CK25', width: 40, align: 'right' },
            { label: '26日<br/>入库', name: 'CK26', width: 40, align: 'right' },
            { label: '27日<br/>入库', name: 'CK27', width: 40, align: 'right' },
            { label: '28日<br/>入库', name: 'CK28', width: 40, align: 'right' },
            { label: '29日<br/>入库', name: 'CK29', width: 40, align: 'right' },
            { label: '30日<br/>入库', name: 'CK30', width: 40, align: 'right' },
            { label: '31日<br/>入库', name: 'CK31', width: 40, align: 'right' },


            { label: '出库<br/>汇总', name: 'CKHZ', width: 40, align: 'right' },
            { label: '返修<br/>数量', name: 'FXSL', width: 40, align: 'right' },
            { label: '废品<br/>数量', name: 'FPSL', width: 40, align: 'right' },

            { label: '盘存<br/>数量', name: 'PCSL', width: 40, align: 'right' },
            { label: '零件类型编码', name: 'FProductionTypeNO', width: 60, align: 'left', hidden: true },
            { label: '零件<br/>分类', name: 'FProductionTypeName', width: 60, align: 'left' },
            ],
            pager: "#gridPager",
            sortname: 'FProductionNO asc,FProCompanyNO desc',
            viewrecords: true,
            //multiselect: true,
            onSelectRow: function (rowId) {
                rowData = $gridList.jqGrid('getRowData', rowId);
                index = rowId;
                $.each(rowData, function (key, value) {
                    $("#txt" + key).val(value);
                });
            }
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: {
                    fAccountDate: $("#FAccountDate").val(),
                    fProductionNO: $("#FProductionNO").val(),
                    fProductionName: $("#FProductionName").val(),
                    fProCompanyNO: $("#FProCompanyNO").val(),
                    fProductionTypeName: $("#FProductionTypeName").val(),
                },
            }).trigger('reloadGrid');
        });
    }
    function btn_Excel() {
        $.detailOpen({
            id: "Detail",
            title: "",
            url: "/WareHouse/Export/WareHouseNoticeExcel"
        });
    }
    function btn_Print() {
        $.detailOpen({
            id: "Detail",
            title: "",
            url: "/WareHouse/Print/WareHouseNoticePrint"
        });
    }
</script>
<body>
    <div id="layout" style="height: 80%; width: 100%;">
        <form id="form1">
            <div style="padding: 12px 0 5px 0; padding-left:15px; border-bottom:1px solid #ccc;" class="line-table input-width-140">
                <div class="btn-group" style="margin-top:-9px;margin-left:50px;">
                    台账日期<br />
                    <input id="FAccountDate" name="" placeholder="" type="text" class="form-control required" onfocus="WdatePicker({ dateFmt: 'yyyy-MM', isShowToday: false, isShowClear: false });" />
                    &nbsp;
                </div>
                <div class="btn-group" style="margin-top:-9px;">
                    零件编号<br />
                    <input id="FProductionNO" name="" placeholder="" type="text" class="form-control required" />
                    &nbsp;
                </div>
                <div class="btn-group" style="margin-top:-9px;">
                    零件名称<br />
                    <input id="FProductionName" name="" placeholder="" type="text" class="form-control required" />
                    &nbsp;
                </div>
                <div class="btn-group" style="margin-top:-9px;">
                    供货单位<br />
                    <select id="FProCompanyNO" name="F_DutyId" class="form-control">
                        <option value="">==请选择==</option>
                    </select>
                    &nbsp;
                </div>
                <div class="btn-group" style="margin-top:-9px;">
                    零件分类<br />
                    <select id="FProductionTypeName" name="F_DutyId" class="form-control">
                        <option value="">==请选择==</option>
                    </select>
                    &nbsp;
                </div>
                <div class="btn-group">
                    <a id="btn_search" class="btn btn-primary center-block" onclick=""><span class="glyphicon glyphicon-search"></span> 查询</a>
                </div>
                <div class="btn-group" style="float:right;">
                    <a class="btn btn-primary center-block" onclick="$.reload()">  <span class="glyphicon glyphicon-refresh"> </span>&nbsp刷新</a>
                    <a class="btn btn-primary center-block" onclick="">            <span class="glyphicon glyphicon-refresh"> </span>&nbsp计算</a>
                    <a class="btn btn-primary center-block" onclick="btn_Excel()"> <span class="glyphicon glyphicon-download"></span>&nbsp导出</a>
                    <a class="btn btn-primary center-block" onclick="btn_Print()"> <span class="glyphicon glyphicon-print">   </span>&nbsp打印</a>
                </div>
            </div>
            <div class="gridPanel">
                <table id="gridList"></table>
                <div id="gridPager"></div>
            </div>
        </form>
    </div>
</body>

